<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ taglib uri="http://www.ld.com/system/tags" prefix="system"%>
<%@ page trimDirectiveWhitespaces="true" %>
<fmt:setLocale value="zh_CN"/>
<!DOCTYPE html>
<html>
<head>
   	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <title>${applicationScope.projectName }</title>
    <link type="text/css" rel="stylesheet" href="${ctxPath }/css/news/common.css?20200119" />
    <!-- 主题样式  -->
    <link type="text/css" rel="stylesheet" href="${ctxPath }/css/news/theme/redCss.css" id="cssfile"/>
	<!-- layer自定义样式 -->
	<link type="text/css" rel="stylesheet" href="${ctxPath }/css/news/layer-custom.css" />
    <link type="text/css" rel="stylesheet" href="${ctxPath }/css/news/chouui-custom.css" />
    <!-- 依赖树形结构插件 -->
    <%-- <link type="text/css" rel="stylesheet" href="${ctxPath }/webjars/shieldjs/depends/ztree/css/zTreeStyle/zTreeStyle.css?20190326"/> --%>
	<link type="text/css" rel="stylesheet" href="${ctxPath }/css/news/zTree/zTreeStyle.css?20190326"/>
<%-- css调试模式，未压缩 --%>
<c:if test="${shieldsb_debug }">
	<!-- cron表达式插件 -->
	<link type="text/css" rel="stylesheet" href="${ctxPath }/webjars/shieldjs/depends/cron-generator/cronGen.css">
	<!-- qtip2插件 -->
	<link type="text/css" rel="stylesheet" href="${ctxPath }/webjars/shieldjs/depends/qtips/jquery.qtip.css">
	<link type="text/css" rel="stylesheet" href="${ctxPath }/webjars/shieldjs/depends/fullcalendar/fullcalendar.min.css"/>
</c:if>
<%-- css生产模式，压缩 --%>
<c:if test="${!shieldsb_debug }">	
	<link type="text/css" rel="stylesheet" href="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/shieldjs.depends.min.css"/>"/>
</c:if>
    <%-- 有项目名的时候需要定义 --%>
    <link rel="shortcut icon" type="image/x-icon" href="${ctxPath }/favicon.ico">
</head>
<body id="bodydoc">
	<div id="header">
		<div class="hed-l"><h1 class="logo">${applicationScope.projectName }</h1></div>
		<div class="hed-r">
			<div class="hed-t clearfix">
			    <!-- 隐藏字段，用于记录进入该页面后跳转到哪个功能，如：dbImport跳转到双公示导入功能 -->
			    <input type="hidden" id="method" name="method" value="${method}"/>
			    <%-- <div class="hed-l">
			        <input type="hidden" id="toShowHidden"/>
			        <h1 class="logo">${applicationScope.projectName }</h1>
			        <!-- 角色，取第一个 -->
			        <div class="logo-1"><span>${sessionScope.session_user.userRoles[0].name }</span> </div>
			    </div> --%>
			   <%--  <div class="warning">
			    	<span>${applicationScope.projectName }  v${applicationScope.version }</span>
			    </div> --%>
			    <div class="head-nav-l">
	<c:if test="${not empty sessionScope.session_user.userRoles }">
		<shield:listFieldOut var="roleNamesAll" value="${sessionScope.session_user.userRoles }" field="name"/>
		<c:set var="roleNamesShow" value="${sessionScope.session_user.userRoles[0].name }" />
		<c:if test="${fn:length(sessionScope.session_user.userRoles) > 1  }">
			<c:set var="roleNamesShow" value="${roleNamesShow }..." />
		</c:if>
	</c:if>
					<!-- qtips提示，data-title设置标题【非必需】，data-cont设置内容【必需】，data-qtips-class设置样式【非必需】，data-qtips-class=yellow表示取内置的黄色样式【黄色、有阴影、圆角】，
					也可以写完整的样式qtip-yellow qtip-shadow qtip-rounded，shieldSettings为扩展原插件的属性重新定义位置 -->
			    	<b title="用户角色：${roleNamesAll }" class="qtips" data-title="用户角色" data-cont="${roleNamesAll }" shieldSettings="{position:{'my':'bottom left','at':'top center'}}"
			    		data-qtips-class=yellow>[${roleNamesShow }]</b>${sessionScope.session_user.userName }，您好
			    </div>
			    <ul class="head-nav-r">
			    	<shield:token/>
			        <li class="hed-line" title="退出系统"><a href="${ctxPathA}/logout"><img src="${ctxPath }/images/icon/exit.png" />退出</a></li>
<%-- 权限判断 --%>
<shield:permssion type="button">
			        <li class="hed-line" title="常用工具"><a href="#/system/menu-mergely" data-url="${ctxPathA}/to/a/tool/mergely"><img src="${ctxPath }/images/icon/tool.png"/>工具</a></li>
			        <li class="tier-father hed-line"><a ><img id="userInfo" src="${ctxPath }/images/icon/zhuti.png" alt="主题" title="主题切换">主题切换</a>
						<div class="instrument instrument-ff" style="display: none;">
							<ul class="skin">
								<li class="shin-t">默认风格</li>
								<li id="skin_4" data-v="red"><span class="skin_4"></span><a href="javascript:void(0);">红色</a></li>
								<li id="skin_3" data-v="blue"><span class="skin_3"></span><a href="javascript:void(0);">蓝色</a></li>
								<li class="shin-t">简约风格</li>
								<li id="skin_0" data-v="jy-red"><span class="skin_0"></span><a href="javascript:void(0);">红色</a></li>
								<li id="skin_1" data-v="jy-blue"><span class="skin_1"></span><a href="javascript:void(0);">蓝色</a></li>
							</ul>
						</div>
					</li>
			        <li><a href="${ctxPathA}/to/a/tool/markdownFileShow?url=${ctxPath}/docs/readme.md" target="_blank"><img src="${ctxPath }/images/icon/edit.png" alt="开发说明文档" title="开发说明文档">开发说明</a></li>
			        <%-- <li><a id="toShowAccount" class="shieldForward" toShieldMenu="#system>.jvm" style="display: ;cursor: pointer;"><img src="${ctxPath }/images/icon/jmv.png" alt="JVM管理" title="JVM管理">JVM管理</a></li>
			        <li><a id="toShowAccount" class="shieldForward" toShieldMenu="#system>.codegen" style="display: ;cursor: pointer;"><img src="${ctxPath }/images/icon/daima.png" alt="代码生成器" title="代码生成器">代码生成器</a></li> --%>
			        <%-- <li class="hed-line"><a href="#/aboutMe/usercenter_sysusernote" style="cursor: pointer;"><img src="${ctxPath }/images/icon/daima.png" alt="我的便签" title="我的便签">我的便签</a></li> --%>
					<%-- <li class="mr10"><a href="javascript:void(0);" class="shieldDialog " data-url="${ctxPathA }/to/a/usercenter/updatePwd">修改密码</a></li>
					<li><a href="#/aboutMe">个人中心</a></li> --%>
					<li class="name-li"><c:if test="${not empty  sessionScope.session_user.avatar}"><img src="${sessionScope.session_user.avatar }" 
					/></c:if><c:if test="${empty  sessionScope.session_user.avatar}"><img src="${ctxPath }/images/icon/name-t.png"
					/></c:if>&nbsp;&nbsp;${sessionScope.session_user.userName }
						<div class="name-box" style="display: none;">
								<a href="#/aboutMe">个人中心</a>
								<a href="javascript:void(0);" class="shieldDialog " data-url="${ctxPathA }/to/a/usercenter/updatePwd">修改密码</a>
								<a href="#/aboutMe/usercenter_sysusernote">我的便签</a>
								<a href="javascript:void(0);" class="shieldDialog " data-url="${ctxPathA }/toSetDSSource" viewTitle="每日一句设置">每日一句</a>			
						</div>
					</li>
</shield:permssion>
			    </ul>
		    </div>
		    <div class="zi_nav">
	<%-- 权限判断 --%>
	<shield:permssion type="topMenu" value="1">
	        <ul class="head_nav_l" id="topBar">
		<c:forEach var="menu" items="${topMenus }">
			<c:if test="${menu.target == '_blank' }">
				<li ><a id="${menu.pageId }" class="${menu.pageClass }" href="${menu.href }" permId="${menu.pageId }" target="_blank"><span>${menu.name }</span><span class="arrow"></span></a></li>
			</c:if>
			<c:if test="${menu.target != '_blank' }">
				<li id="${menu.pageId }" class="menu ${menu.pageClass }"  <%-- data-url="${menu.href }" --%> permId="${menu.pageId }" ><a href="#/${menu.pageId }"><span>${menu.name }</span><span class="arrow"></span></a></li>
			</c:if>
		</c:forEach>
	            <!-- class需要为menu，原href改为data-url -->
	           <%--  <li class="menu" data-url="${ctxPathA }/to/a/system/leftBar"><span>系统管理</span></li>
	            <li class="menu" data-url="${ctxPathA }/to/a/gov_credit/leftBar"><span>政府信用</span></li> --%>
	          	<!-- <li style="float: right; margin-right:10px;"><a href="index.html"><b id="home">回到首页</b></a></li> -->
	        </ul>
	</shield:permssion>
	
	    	<div class="clear"></div>
			</div>
		</div>
	</div>
	

	<div id="leftBar"><%@ include file="leftBar.jsp" %></div>
	<div id="resize"><span class="resize-img"></span></div>
	<div id="content"></div>
<%-- 权限判断 --%>
<shield:permssion type="button">
	<div id="chat" class="" data-url="shield_chat"><%@ include file="chat.jsp"   %></div>
</shield:permssion>

	<script type="text/javascript">
		var refresh = '${refresh}';
		if (refresh) {
			window.location.reload();
        }
		uploadBaseUrl = "${uploadBaseUrl}"
		uploadUeRootPath = uploadBaseUrl+"/ueditor/upload";
        uploadImageHost = "${uploadImageHost}";
		host = window.location.host;
		uploadCallbackURL =  "http://"+host+"${ctxPath}/${uploadCallbackURL}";
		uploadGroup = "${uploadGroup}"; //项目上传到的组，区分不同地区的项目
		ctxPath = "${ctxPath}";
		//uploadCallbackURL = "?callback=http://" + host + ctxPath + "/" + uploadRootPath;
		//alert(uploadCallbackURL)
	</script>
	<script type="text/javascript" src="${ctxPath }/js/lib/jquery-1.12.4.min.js"></script>
	<!-- 依赖弹出框插件,不能压缩，里面牵扯到路径引用 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/layer/layer.js"></script>
	<!-- 依赖日期插件 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/My97DatePicker/WdatePicker.js"></script>
<%-- js调试模式，未压缩 --%>
	<!-- 算术运算类 -->
	<script src="${ctxPath }/js/lib/arithUtil.js"></script>
	<!-- jquery-ui -->
	<script type="text/javascript" src="${ctxPath }/js/lib/jquery-ui/jquery-ui.min.js" ></script>
<c:if test="${shieldsb_debug }">
	<!-- 注意引入顺序 -->
	<!-- 依赖原数据插件 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/jquery.metadata.js"></script>
	<!-- 依赖树形结构插件 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/ztree/jquery.ztree.core.min.js"></script>
	<!-- cron表达式插件 -->
    <script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/cron-generator/cronGen.js"></script>
    <!-- qtip2插件 -->
    <script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/qtips/jquery.qtip.js"></script>
	<!-- 依赖form插件【必需】 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/tool/form/jquery.form.min.js"></script>
	<!-- 模板工具【必需】 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/tool/doT.js"></script>
	<!-- 表单验证插件【必需】 -->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/tool/formvalidate.js"></script>
	
	<script type="text/javascript"  src="${ctxPath }/webjars/shieldjs/depends/fullcalendar/lib/moment.min.js" ></script>
	<script type="text/javascript"  src="${ctxPath }/webjars/shieldjs/depends/fullcalendar/lib/lunar.js" ></script>
	<script type="text/javascript"  src="${ctxPath }/webjars/shieldjs/depends/fullcalendar/fullcalendar.js"></script>
	<script type="text/javascript"  src="${ctxPath }/webjars/shieldjs/depends/fullcalendar/locale/zh-cn.js" ></script>
	
	<!-- 未压缩的，调试时可放开 begin -->
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/core/shield.util.js"/>"></script>
	<!--  框架js ====主入口【必需】 ==== -->
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/core/shield.main.js"/>"></script>
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/core/shield.core.js"/>"></script>
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/core/shield.HtmlAction.js"/>"></script>
	<!-- 框架js====扩展插件====【必需】 -->
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/impl/chou/modules/shieldjs.tab.js"/>"></script>
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/impl/chou/shield.chou.HtmlAction.extend.js"/>"></script>
	<!-- 未压缩的，调试时可放开 end -->
</c:if>
<%-- js生产模式，压缩 --%>
<c:if test="${!shieldsb_debug }">
	<%-- 压缩的,分两种，包含依赖库的shield.chou.all.min.js和只包含基本库，不包含第三方的依赖库的shield.chou.min.js --%>
	<%-- <script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/impl/chou/shield.chou.min.js"/>"></script> --%>
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/webjars/shieldjs/impl/chou/shield.chou.all.min.js"/>"></script>
</c:if>
	
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/js/shieldjs2/impl/chou/extends/shield.HtmlAction.extend.js"/>"></script>
	<script type="text/javascript" src="${ctxPath }<shield:getResourceVersion lookupPath="/js/shieldjs2/impl/chou/extends/shield.extend.js"/>"></script>

    <!-- <%-- 百度UEditor --%> -->
	<script type="text/javascript" charset="utf-8" src="${ctxPath }/js/lib/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="${ctxPath }/js/lib/ueditor/ueditor.all.js"> </script>
	<!--建议手动加载语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
	<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	<script type="text/javascript" charset="utf-8" src="${ctxPath }/js/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
	<!--  ztree依赖-->
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/ztree/jquery.ztree.excheck.min.js"></script>
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/ztree/jquery.ztree.exedit.min.js"></script>
	<script type="text/javascript" src="${ctxPath }/webjars/shieldjs/depends/ztree/jquery.ztree.exhide.min.js"></script>
	<!--  table拖拽-->
	<script type="text/javascript" src="${ctxPath }/js/lib/jquery.tablednd.min.js"></script>
	
	<script type="text/javascript" src="${ctxPath }/js/lib/jquery.cookie.js"></script>
	<script type="text/javascript" src="${ctxPath }/js/lib/q.js"></script>
	
	<!-- timedroper/timedroper.js -->
	<link rel="stylesheet" type="text/css" href="${ctxPath }/js/lib/timedroper/timedropper.css">
	<script type="text/javascript" src="${ctxPath }/js/lib/timedroper/timedroper.js"></script>
	
	<script type="text/javascript" src="${ctxPath }/js/chat.js?2019022601"></script>
	<!--  select2 -->
	<link href="${ctxPath }/js/lib/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${ctxPath }/js/lib/select2/js/select2.full.min.js" ></script>
	<script type="text/javascript" src="${ctxPath }/js/lib/select2/js/i18n/zh-CN.js" ></script>
	<!--  上传 -->
	<script type="text/javascript" src="${ctxPath }/js/lib/ajaxupload/ajaxupload.js"></script>
	<!-- 鼠标悬停放大 -->
	<script type="text/javascript" src="${ctxPath }/js/lib/toolTip.js"></script>
	<!-- 鼠标右键 -->
	<script type="text/javascript" src="${ctxPath}/js/lib/jquery.contextmenu.r2.js?20190903085211"></script>

	<!-- 侧边栏-->
	<script type="text/javascript" src="${ctxPath }/js/lib/sideToggle/js/velocity-1.2.3.min.js"></script>
	<script type="text/javascript" src="${ctxPath }/js/lib/sideToggle/js/sideToggleExtended.js"></script>

	<!-- 倒计时插件-->
	<script type="text/javascript" src="${ctxPath }/js/lib/countdown/countDown.js"></script>

	<script type="text/javascript">
	 	// ShieldJS.debug方法输出堆栈信息（建议正式环境下去掉）
		ShieldJS.debugTrace = true;
	 	
		ShieldJS.init({
			/** 头部 *//* topBar: '#header', 旧*/
			topBarE: '#header' 
			/** 菜单栏*//* ,navMenu: '#topBar', */
			,topMenuE: '#topBar' 
			/** 内容区多页签选项卡选中的样式*/
			,headerCurClass : 'current cur'
		});
		//切换皮肤
		if ($(".tier-father").length > 0 && $(".instrument").length > 0) {
			$(".tier-father").hover(function(){
				$(".instrument").toggle();
			});
			$(".instrument").find("li").click(function(){
				var skinName = $(this).data("v");
				if (skinName) {
					switchSkin(skinName);
                }
			});
			function switchSkin(skinName){
			    $('[data-v="'+skinName+'"]').addClass("selected").siblings().removeClass('selected'); //移除同辈元素的selected
				$("#cssfile").attr('href', '${ctxPath }/css/news/theme/'+skinName+'Css.css');
			 
				$.cookie("MyCssSkin", skinName, {path:'/', expires:3650});
			}
			var cookie_skin=$.cookie("MyCssSkin");
			if(cookie_skin){
				switchSkin(cookie_skin);
			}
		}
		//个人中心
		$(".name-li").hover(function(){
			$(".name-box").toggle();
		});
		$("body").find(".menu[id]").each(function(){ //头部菜单
			var $this = $(this);
			var thisId = $this.attr("id");
			Q.reg(thisId, function(leftMenuId){
				console.log('打开'+thisId+" "+leftMenuId);
				ShieldJS.topMenuE.data("doclick", "false"); //不选中默认节点,如果为ajax获取内容且为第一个则不能设置
				setTimeout(function() { //延时，给其他事件的绑定时间
					console.log('打开'+thisId+'^run');
					if (leftMenuId) {
						if (!$this.hasClass("active")) {
							$this.triggerHandler("click",["false"]); //不选中默认节点
						}
						setTimeout(function() { //延时，给其他事件的绑定时间
							if (!$("#"+leftMenuId).hasClass("active")) { //防止重复点击
								var leftMenuEle = $("#"+leftMenuId);
								leftMenuEle.click();
								var t_a = leftMenuEle.offset();
								var siderE = ShieldJS.siderE;
								siderE.scrollTop(0).animate({scrollTop:(t_a.top-siderE.height()/2-siderE.offset().top)+ "px"}, 800); //滚动到窗口中间
                            }
						}, 80);
					} else {
						if (!$this.hasClass("active")) {
							$this.triggerHandler("click"); //选中默认节点
						}
					}
				}, 20);
				return false;
			});
		});
		Q.reg('home',function(){
			console.log('打开了首页');
			//document.getElementById('m').innerHTML='Hello World';
		});
		// xxxxx/#/aboutMe
		Q.init({
			key:'/',/* url里#和url名之间的分割符号 默认为感叹号 */
			index:'home'/* 首页地址 如果访问到不能访问页面也会跳回此页 */
		});
		// websocket聊天
		if(jQuery().shieldChat){
			$("#chat-container").shieldChat({serviceURL :"ws://"+window.location.host+ctxPath+"/chat/"});
		}
	</script>
	<!-- 引入远程socket.io.js -->
	<script src="${ctxPath }/js/webnotice/socketio.util.js"></script>
	<script type="text/javascript">
	    <!-- 实时从指定查看是否有消息 -->
	    $(function() {
	    	var uid = '${sessionScope.session_user.id }';
         	var opts = {
             	query: 'uid=' + uid
         	};
	    	socketioServerInit('${applicationScope["socketio.server.host"]}:${applicationScope["socketio.server.port"]}', opts, {
		    	"public_msg" : function(data, ackServerCallback){
		    		if (ackServerCallback) { //传回到服务器端的信息
    					ackServerCallback('success');
    				}
			        alert("公共信息=="+data.message+"来自【"+data.fromUserName+"】");
			        // var personInfo = JSON.parse(data);
			        // console.log(personInfo);
			    }
	    		,"private_msg" : function(data, ackServerCallback){
		        	if (ackServerCallback) { //传回到服务器端的信息
    					ackServerCallback('success');
    				}
		        	alert("私人信息=="+data.message+"来自【"+data.fromUserName+"】");
		    	}
		    	,"connect" : function() { //创建连接
	    			// 发送握手请求
	    			var jsonObject = {
	    				fromUserId : parseInt(uid),
	    				message : "hello"
	    			};
	    			this.emit('helloevent', jsonObject); //hello事件

	    			this.on('hellopush', function(data, ackServerCallback, arg1) {
	    				console.log("hellopush--" +data+" arg1="+arg1)
	    				// base64转码的数据，可忽视
	    				/* YUNM.session = {
	    					sessionId : $.base64.atob(data.sessionId),
	    					time : $.base64.atob(data.time)
	    				}; */
	    				if (ackServerCallback) { //传回到服务器端的信息
	    					ackServerCallback('server message was delivered to client!');
	    				}
	    			});
	    		}
		    	
		    });
	    	
		   /* connectQuotation('2', function() {
		    	socket.on("pushQuotation", function(message) {
		    		if (message.type == "dealOrder") {
		    			var msg = message.response.result;
		    			// 输出服务端消息
		    			alert(msg);
		    		}
		    	});
		    }); */
	    });
	    ShieldJS.ajax.post("${ctxPathA}/daliySentence", {}, function(data) {
    		if (data.success) {
    		}
		});
	</script>
</body>
</html>